home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / elecmail / cs_mac07.zip / LOGON.MAC < prev    next >
Text File  |  1993-03-28  |  23KB  |  588 lines

  1. 4
  2.  ┌────────────────────────────────┐
  3.  │  Chuck Seyboldt's COMMO Macro  │   CS-MAC07:LOGON.MAC
  4.  └────────────────────────────────┘
  5.   *
  6.   *  Contents:       Generic logon routine (:glr)
  7.   *                  Test for ACTION (and call to ACTION.MAC)
  8.   *                  Get NEWFILES list if %flag contains "n"
  9.   *                  Getting to mail door
  10.   *                  Rename .QWK packets
  11.   *                  Test for .REP
  12.   *
  13.   *  Called from:    TABLE.MAC
  14.   *
  15.   *  Control passes to:  ACTION.MAC,action    (if ACTION.%abbr exists)
  16.   *                      COMMO.MAC,aln        (multi-dialer routine)
  17.   *
  18.   *  The file you are reading does  *NOT*  require editing.
  19.   *
  20. ***  BBSID particulars need to be added to COMMO.FON.
  21.   *
  22.   *  This file contains a logon macro.
  23.   *  It is designed to get you quickest to the "Main BBS Command?"
  24.   *  prompt.  BBSware specific prompts are delivered from TABLE.MAC.
  25.   *  After logon, a MAILRUN is made.  If the Commo variable BBSID is
  26.   *  empty, control passes back to COMMO.MAC.
  27.   *
  28.   *  This works for PCBoards, for the RBBS run by Jim Goodenough,
  29.   *  Directory Assistance  (1,707 823-9516), for Shad Muegge's
  30.   *  BABBLE BBS (1,707 538-1507), for Mark Turner's ESCape running
  31.   *  GAP software (1,714 698-9568), for Mike Martell's Wolf's Moon
  32.   *  running Spitfire (1,207 772-9093), for Jeff Oberlee's Charlies
  33.   *  Foxhole BBS running MAXIMUS-CBCS (1,517 323-3405), and for
  34.   *  Wildcat! boards.
  35.   *  Always adding more prompts to accomodate more BBS types.
  36.   *  In general, turn any BBS HOTKEY option to OFF.
  37.   *
  38.  ┌─────────────────────────────┐
  39.  │  Standard Online Responses  │  (For the Generic Logon Routine)
  40.  └─────────────────────────────┘
  41.   *  Responses to common logging-on prompts.
  42.   *  Notice that I have a different response to the "First name?"
  43.   *  prompt for the BBS called Directory Assistance.
  44.  
  45.  {:retu} {retu}                     ;Handy label and function assignment
  46.  
  47.  {:lof}  {comp abbr,di} {ifco lof1} ;If BBS=DIRASNT, send TURBO login
  48.          {send ~%name%|}     {retu} ; otherwise, just send name.
  49.  {:lof1} {send %name %_pas !main|}
  50.          {alarm 1} {retu}
  51.  
  52.  {:lov}  {send ~%v_ph%|}     {retu} ;Voice Phone Number verification
  53.  {:lod}  {send ~%d_ph%|}     {retu} ;Data  Phone Number verification
  54.  {:lob}  {send ~%b_day%|}    {retu} ;Birthday verification
  55.  {:loq}  {send ~%grafix%|}   {retu} ;choose ANSI colors  "Y/n"
  56.  {:bbs|} {send ~bbs|}        {retu}
  57.  {:|}    {send ~|}           {retu}
  58.  {:_|}   {send ~ |}          {retu}
  59.  {:c|}   {send ~c|}          {retu}
  60.  {:g|}   {send ~g|}          {retu}
  61.  {:n|}   {send ~n|}          {retu}
  62.  {:q|}   {send ~q|}          {retu}
  63.  {:s|}   {send ~s|}          {retu}
  64.  {:y|}   {send ~y|}          {retu}
  65.  {:z|}   {send ~z|}          {retu}
  66.  {:0|}   {send ~0|}          {retu}
  67.  {:_}    {send ~ }           {retu} ;this is how to send "SpaceBar"
  68.  {:loe}  {send ~~^[^[}       {retu} ;this is sending two "Esc" presses
  69.  {:pas|} {send %_pas|}       {retu} ;this sends your password
  70.  
  71.  ┌─────────────────────────┐
  72.  │  Generic Logon Routine  │
  73.  └─────────────────────────┘
  74.   *  This logon macro works for times you DON'T want to
  75.   *  make a mail run.  It is designed to get you quickest to the
  76.   *  "Main BBS Command?" prompt.
  77.   *
  78.   *  It is necessary that this routine be reached via TABLE.MAC
  79.   *  since several BBS prompts are set there.
  80.  
  81.  {:glr}
  82.           disp ,,,Logging on Now^m^j^j
  83.           spdc n                    ;Blind display "for the bold"
  84.  
  85.          {sete-p0 esc}              ;point to ESCape routine
  86.          {setv nodl} {setv count}   ;set some working variables
  87.          {capt n}                   ;turnoff capture if open
  88.          {setl 60,bye,15,|}
  89.          {push}                     ;push + pops ≈ call
  90.          {ifca ,alm}                ;Skip routine if OFFline
  91.  
  92.          {golo alm,NO CARRIER^m}    ;Forces skip when carrier lost
  93.          {golo _|,Login: }          ;NLBBS Front End
  94.          {golo n|,A>?}              ;just say 'no' RBBS prompt
  95.  
  96.          {golo n|,change?}          ;PCBoard  "Language" prompt
  97.          {golo loq,hics (}          ;PCBoard  "Graphics" prompt
  98.          {golo loq, yes :}          ;GAP      "Graphics" prompt
  99.  
  100.          {golo y|,orrect?}          ;send 'y' when caller ID is asked
  101.          {golo y|,? [y/N]}          ;Spitfire "Graphics" prompt
  102.          {golo onl,mmand?}          ;Logged on via "quick" RBBS logon
  103.  
  104.          {golo loe, twice}          ;send Escape twice  "Front End"
  105.          {golo loe, (ESC)}          ;send Escape twice  "Binkley"
  106.          {golo loe,ESCape}          ;send Escape, another Binkley
  107.  
  108.          {golo y|, [Y,n]?}          ;MAXIMUS BBS "name?" confirmation
  109.  
  110.          {golo lof,%nam_pmt}        ;send name "Prompt from TABLE.MAC"
  111.  
  112.          {look Password}            ;Logon macro now has two "lookfors"
  113.          {pops}                     ; Why?  To accomodate more golooks.
  114.          {paus 1}
  115.          {call pas|}                ;send password
  116.  
  117.          {push}
  118.          {ifca ,alm}                ;Skip routine if OFFline
  119.          {setl 60,bye,20,n|}        ;Start of "Logon, Part II"
  120.  
  121.          {golo %bypass1}            ;These BBSware specific 'pause-
  122.          {golo %bypass2}            ;  avoiding-responses' are set in
  123.          {golo %bypass3}            ;  TABLE.MAC
  124.  
  125.          {golo n|,More?}            ;just say 'no' to "More?"
  126.          {golo n|,inue?}            ;just say 'no' to "Continue?"
  127.          {golo n|,=yes?}            ;just say 'no' to "mail scan"
  128.  
  129.          {golo lod,TA ph}           ;More Wildcat! prompts <sigh>
  130.          {golo n|,menu? [}          ;No to Wildcat! bulletin menu
  131.          {golo c|,se- [C]}          ;[C]ontinue to -pause- prompt
  132.  
  133.          {golo n|,N)?}              ;just say 'no' RBBS prompt
  134.          {golo n|,[Y/n]}            ;just say 'no' to "mail scan"
  135.          {golo pas|,Wrong}          ;resend password if necessary
  136.  
  137.          {look %bbs_pmt}            ;Generic Logon Complete
  138.  {:onl}  {spdc y}    {pops}         ;All set.  Logged-ON.
  139.  
  140.  ┌─────────────────────────┐
  141.  │  Call ACTION Processor  │
  142.  └─────────────────────────┘
  143.  
  144.  {ifex %_hom%action.%abbr%,,noact}             ;CALL "ACTION processor"
  145.          {alar 1} {paus 1} {disp ,,,^j^j}
  146.          {disp ,18,1E,▌ 'S' to skip ACTION  ■  Any other key continues ▐}
  147.          {disp ,,,^m}
  148.          {setg 15,doact,n}                     ;if response is <CR>, do!
  149.          {gets-h resp,1,doact}                 ;using Commo for timed branch
  150.          {comp resp,s} {ifco noact}            ;15 second delay, default=do!
  151. {:doact} {macl action.mac,action}              ;ACTION.MAC Returns to :noact
  152.  
  153.  ┌─────────────────────────┐
  154.  │  MailRun Routine Start  │
  155.  └─────────────────────────┘
  156.  ┌────────────────────────────────────────────┐
  157.  │  "flagged" events may be called from here  │
  158.  └────────────────────────────────────────────┘
  159.   *  A %flag% variable is used to call for NEWFILE scans.
  160.   *  You should set the %flag variable in COMMO.FON
  161.   *  Setting .... {flag,n} ... "n" runs :NEWFILES,
  162.   *
  163.   *  This facility is setup for easy expansion.
  164.  
  165.  {:noact}{push}
  166.          {inst %flag,n} {ifco newfiles}
  167.          {pops}
  168.          {comp bbsid}                          ;Check %bbsid variable
  169.          {ifco esc}                            ;If empty, quit macro here
  170.          {ifca ,alm}                           ;If Offline, quit here
  171.  
  172.  ┌───────────────────┐
  173.  │  MailRun Routine  │
  174.  └───────────────────┘
  175.   *  Checking for a .REP file.  If a REP exists, you are offered
  176.   *  the option to only upload those replies.  But, the default action
  177.   *  is to get a QWK.  This way, unattended sessions fetch a .QWK
  178.   *  Or, by setting the variable %skip to "nl", you can skip the
  179.   *  attempt to download mail from the "NLBBS".
  180.  
  181.          {ifex %repdr\%bbsid.%rep,ask,d_l}      ;GOTO mailrun routines
  182.  {:ask}  {comp skip,%abbr} {ifco n_u}
  183.          {comp skip,y}     {ifco n_u}
  184.          {alar 1} {paus 1} {disp ,,,^j^j}
  185.          {disp ,18,1E,▌ (C)ontinue mail d/l NOW ■ 'S' to skip d/l ▐}
  186.          {disp ,,,^m}
  187.          {setg 15,d_l,n}{gets-h resp,1,d_l}    ;using Commo for timed branch
  188.          {comp resp,c} {ifco d_l}              ;15 second delay, default=d/l
  189.          {comp resp, } {ifco d_l}
  190.          {comp resp,s} {ifco n_u}
  191.  {:n_u}  {setv nodl,y}                         ;set flag to skip mail d/l
  192.  
  193.  ┌───────────────────────────────┐
  194.  │  Get to the Mail Door Prompt  │
  195.  └───────────────────────────────┘
  196.  
  197.  {:d_l}  {ifca ,retu}               ;return to COMMO.MAC if offline
  198.          {send ~~%dorno}
  199.          {setl 60,bye,30,%yes}
  200.          {golo byz,invalid}         ;for invalid door selection
  201.          {push}
  202.          {golo |,inue>}             ;for Jimmer  Startup
  203.          {golo |,inue:}             ;for JetMail Startup
  204.          {golo |,inue?}             ;for MarkMail Startup
  205.          {golo y|,inue...}          ;for QM4 prompt
  206.          {golo ndl,sorry,}          ;for T.A.G. unable to enter door
  207.          {look %md_pmt}             ;from TABLE.MAC prompt table
  208.  
  209.  ┌─────────────────┐
  210.  │  Upload a .REP  │
  211.  └─────────────────┘
  212.   *  If a .REP exists, it is sent before any attempt is made to download.
  213.  
  214.  {:qul}  {pops}
  215.          {ifca ,retu}
  216.          {ifex %repdr\%bbsid.%rep,,nup}
  217.          {send ~~u|}
  218.          {setl 30,bye,,}
  219.          {call ulrep-%mprot}        ;%mprot selected in CS-MACxx.CFG
  220.          {setl 60,bye,15,|}
  221.          {push}
  222.          {golo |,inue?}             ;for MarkMail
  223.          {golo y|,inue...}          ;for QM4 prompt
  224.          {look %md_pmt}
  225.  
  226.  ┌───────────────────┐
  227.  │  Download a .QWK  │
  228.  └───────────────────┘
  229.   *  The ":nup" section would be skipped if you decided to skip .QWK
  230.   *  downloading in the "Mailrun Routine Start, :ask" section.
  231.  
  232.  {:nup}  {pops}
  233.          {comp nodl,y} {ifco byz}   ;Skip d/l if %nodl=y
  234.          {send ~~~d|}               ;Otherwise, scan messages
  235.          {push}
  236.          {setl 100,bye,45,%yes}
  237.          {golo p_flg,extracting personal mail}  ;ZIPNEWS personal mail
  238.          {golo ndl,%mt_qwk}         ;eMpTy .QWK message "from TABLE.MAC"
  239.          {golo %md_brnch}           ;Branch, refer to MAILware TABLE.MAC
  240.          {look Message Count}
  241.          {goto qdl}
  242.  
  243.  {:p_flg}{setv pmail,y} {retu}      ;Causes "P" display in Autopilot Mode
  244.                                     ;Cleared on Alt-C or on Alt-A "No" response
  245.  ┌──────────────────┐
  246.  │  Count Messages  │
  247.  └──────────────────┘
  248.   *  This section will skip the RENQWK and any attempt to download if
  249.   *  MarkMail scans less than 30 messages for your .QWK packet.
  250.  
  251.  {:mc2}
  252.          {setg ,,l,^m}              ;MarkMail2 message counting
  253.          {gets count,15}            ;get total message count   w/ANSI
  254.          {subs count,-4,4,%count}   ;take last 4 characters  total
  255.          {look sages: }             ;MM2 personal message count
  256.          {gets person,15}           ;get personal message count  w/ANSI
  257.          {subs person,-4,4,%person} ;take last 4 characters  personal
  258.          {look %xfer_pmt}
  259.          {comp person,1}            ;check for personal messages
  260.          {ifco-GE qdl}              ; if any, do download ... but ...
  261.          {comp count,30}            ;if less than 30 total messages,
  262.          {ifco-L ndl,qdl}           ; then skip download
  263.   *                                 ;else, do the qwk download
  264.   *
  265.   *  Here is a counting section for Charlie's Offline reader
  266.   *  It is possible to add counting routines specific to any MAILware.
  267.   *  Use the variable %md_branch defined in TABLE.MAC to choose the
  268.   *  appropriate message counting routine.
  269.  
  270.  {:col1}
  271.          {setg ,,l,^m}
  272.          {gets count,6}             ;for Charlie's Offline Reader
  273.          {subs count,-2,2,%count}   ;take last 2 characters  total
  274.          {look %xfer_pmt}
  275.          {comp count,25}
  276.          {ifco-L ndl,qdl}
  277.   *
  278.   *  Here is a counting section for Jack Kilday's ZIPNEWS Door
  279.  
  280.  {:zns1}
  281.          {setg ,,l,^m}
  282.          {gets count,7}
  283.          {subs count,-3,3,%count}
  284.          {golo ndl,%mt_qwk}         ;ZIPNEWS "empty" occurs after count
  285.          {look %xfer_pmt}
  286.          {comp count,10}
  287.          {ifco-L ndl,qdl}
  288.  
  289.  ┌────────────────────────────┐
  290.  │  .QWK rename and Download  │
  291.  └────────────────────────────┘
  292.   *  Renaming is much faster with one call to a batch file than several
  293.   *  COMMO calls to command.com.  Passing these variables from COMMO.MAC
  294.   *  to renqwk.bat.  %1 = %qwkdr : %2 = %bbsid : %3 = %abbr  %4 = %qwk
  295.   *
  296. *┌───────────────  renqwk.bat  ─┐    <--  cut here  --
  297. *│  @echo off                   │
  298. *│  ctty nul                    │
  299. *│                              │
  300. *│  del %1\%3__5.%4             │
  301. *│  ren %1\%3__4.%4  %3__5.%4   │
  302. *│  ren %1\%3__3.%4  %3__4.%4   │
  303. *│  ren %1\%3__2.%4  %3__3.%4   │
  304. *│  ren %1\%3__1.%4  %3__2.%4   │
  305. *│  ren %1\%2.%4     %3__1.%4   │
  306. *│                              │
  307. *│  ctty con                    │
  308. *└──────────────────────────────┘    <--  cut here  --
  309.   *
  310.   *  An option to the BAT file renaming method is to do renaming
  311.   *  with a macro.  Several macro methods are later in this file.
  312.   *  You choose which method to use by presence or absence of renqwk.bat
  313.   *  in your Commo home directory.
  314.   *
  315.   *  renqwk.bat present in Commo home directory  ...  use renqwk.bat
  316.   *  renqwk.bat absent from Commo home directory ...  use :renqwk macro
  317.  
  318.  {:qdl}  {pops}
  319.          {push}                          ;return here from :renqwk
  320.          {ifex %qwkdr\%bbsid.%qwk,,gonow} ;check for .QWK before rename
  321.          {ifex %_hom%renqwk.bat,,renqwk} ;use .BAT if it exists
  322.   *                                      ; otherwise use :renqwk routine
  323.   *                                      ; in Commo macro language
  324.   *
  325.          {exec-n %_hom%renqwk %qwkdr %bbsid %abbr %qwk} ;.QWKfile rename
  326.   *                                                     ; via renqwk.bat
  327.  {:gonow}{send ~~%yes}
  328.          {call dlqwk-%mprot}        ;download the .qwk
  329.  {:ndl}  {pops}
  330.          {setl 30,bye,10,%no}
  331.          {comp mail,dcq}            ;DCQwk does not have a logoff
  332.          {ifco md_bbs}              ; from door facility.
  333.          {comp mail,zns}            ;ZIPNEWS returns to BBS after d/l,
  334.          {ifco md_bbs}              ; so set lookfor prompt to = BBS
  335.          {goto notag}               ; command? prompt
  336.  
  337.  {:md_bbs}
  338.          {golo md_2,Returning . . .};ZIPNEWS returning to PCBoard
  339.          {look %md_pmt}
  340.          {send %quit}
  341.  {:md_2} {setv quit,|}              ;Reset %quit
  342.          {setv mail}
  343.          {setv md_pmt,%bbs_pmt}     ;This returns to BBS for logoff.
  344.  
  345.  {:notag}{push}
  346.          {golo y|,inue...}          ;for QM4 "continue" prompt
  347.          {golo |,inue?}             ;for MarkMail
  348.          {look %md_pmt}             ;from MailDoor prompt table
  349.  
  350.  ┌───────────────────────────────────────────────────────────────────┐
  351.  │  Loop to TABLE.MAC and LOGON:noact for multiple doors in one call │
  352.  └───────────────────────────────────────────────────────────────────┘
  353.   *  The variable %bbs is set to NUL on the first pass through TABLE.MAC.
  354.   *  If TABLE.MAC,%mail is called with a NUL %bbs variable, TABLE.MAC will
  355.   *   return control to LOGON:noact
  356.  
  357.   *  To enter a second door on one call, set a variable, %door2, in
  358.   *  COMMO.FON.  You will set %mail, %dorno, and %bbsid in %door2.
  359.   *  Example; (door2,znr,zipnews cboldt|,nlbbs)
  360.  
  361.  {:byz}  {pops}
  362.          {comp door2}               ;is there a %door2 variable?
  363.          {ifco byz2}                ;if not, bye now!
  364.  
  365.          {send %quit}               ;quit the mail door
  366.          {setl 60,bye,10,|}         ;send empty CR to clear "extra" commands
  367.          {look %bbs_pmt}
  368.          {inst door2,,}             ;find first "," in %door2
  369.          {setv pos,%_pos} {decr pos}
  370.          {subs mail,1,%pos,%door2}  ;portion before "," is %mail (MAILWare)
  371.          {incr pos,2}
  372.          {subs door2,%pos,80,%door2};portion after "," is %dorno and %bbsid
  373.          {inst door2,,}             ;find second "," in %door2
  374.          {setv pos,%_pos} {decr pos}
  375.          {subs dorno,1,%pos,%door2} ;portion before "," is %dorno entry command
  376.          {incr pos,2}
  377.          {subs bbsid,%pos,9,%door2} ;portion after "," is %bbsid
  378.          {setv door2}               ;clear second door variable
  379.          {macl table.mac,qwk}       ;Will return to LOGON.MAC:noact
  380.  
  381.  ┌──────────────────────┐
  382.  │  LogOFF or Stay on?  │
  383.  └──────────────────────┘
  384.   *  Again a choice.  Default is to end the connection, but you may
  385.   *  stay ONLINE if you wish.  The macro is setup to open a capture
  386.   *  file if you choose to stay online.
  387.  
  388.  {:byz2} {paus 1} {alarm 1} {parm ,,,,0} {disp ,,,^j^j}
  389.          {disp ,18,1E,▌ 'G' to LogOFF NOW ■ SpaceBar to stay ON  ▐}
  390.          {disp ,,,^m}
  391.          {setg 10,bye,n} {gets-h resp,1,bye};using Commo for timed branch
  392.          {comp resp,g} {ifco bye}           ;10 second delay, default=bye
  393.          {comp resp, } {ifco sta}
  394.  {:sta}  {clea}
  395.          {setv bbsid}
  396.          {setv capture}             ;clear flag to avoid closing .CAP
  397.          {macl %_mac,chm}           ;commo.mac:chm opens capture file
  398.  
  399.  {:bye}  {ifca ,alm}                ;Skip routine if OFFline
  400.          {send %bye%%rs}
  401.          {setl 10,,,}
  402.          {push}
  403.          {golo loe,<esc>}           ;stifle host delays
  404.          {golo y|, log off }
  405.          {golo n|, comment }
  406.          {golo |,?=help]?}          ;Charlie's Foxhole
  407.          {look NO CARRIER^m^j}      ;comes from modem
  408.          {pops}
  409.  {:bya}  {hang y}
  410.          {setv lastcall,%bbsid}     ;save lastcall info
  411.          {setv bbsid} {setv dorno}  ;and recycle variables
  412.          {setv nodl}  {setv abbr}
  413.          {paus 5}
  414.          {macl %_mac,%rflag}        ;Dial next marked BBS
  415.  
  416.  {:alm}  {setv bbsid}               ;if exit w/NO CARRIER
  417.          {setv abbr}                ; this macro routine
  418.          {macl %_mac,%rflag}
  419.  {:esc}  {setv bbsid}               ;if exit by pressing ESCape
  420.          {setv abbr}
  421.          {macl %_mac}
  422.  
  423.  ┌──────────────────────────────┐
  424.  │  .QWK file rename via macro  │
  425.  └──────────────────────────────┘
  426.   *  There are many ways to rename mail packets.  The variable %rdr
  427.   *  is used to branch to whatever rename method you prefer.  The
  428.   *  default method uses the date as part of the name and allows
  429.   *  up to 10 .qwk packets of the same date
  430.   *  (NL-1108.QWK --> NL-1108.QW0 --> NL-1108.QW1 --> etc.)
  431.   *
  432.   *  It would be very easy to change this progression to keep
  433.   *  the file extension ".qwk"
  434.   *  (NL-1108.QWK --> NL-11080.QWK --> NL-11081.QWK --> etc.)
  435.  
  436.  {:renqwk}
  437.          {comp rdr}     {ifco ,%rdr}
  438.  
  439.  {:qwk}  {ifex %qwkdr\%abbr%-%_mon%%_day.%qwk,m_dat}
  440.          {exec-n ren %qwkdr\%bbsid.%qwk %abbr%-%_mon%%_day.%qwk}
  441.          {retu}
  442.  {:m_dat}{setv count,0}
  443.  {:m_lop}{ifex %qwkdr\%abbr%-%_mon%%_day.qw%count,,r_mul}
  444.          {incr count}
  445.          {goto m_lop}
  446.  {:r_mul}{exec-n ren %qwkdr\%bbsid.%qwk %abbr%-%_mon%%_day.qw%count}
  447.          {retu}
  448.  
  449.   *  Rename method ala JABBER.
  450.   *
  451.  {:jbr}  {exec-n dir %qwkdr\%bbsid.* > %ramdr\temp}
  452.          {setv ext,0}
  453.          {rope %ramdr\temp,j_ren}
  454.  {:jbr_l}{read line}
  455.          {subs count,10,3,%line}
  456.          {comp count,%ext}
  457.          {ifco-ge ,jbr_l}
  458.          {setv ext,%count}
  459.          {goto jbr_l}
  460.  {:j_ren}{incr ext}
  461.          {leng %ext}
  462.          {comp %_len,3} {ifco n_pad}
  463.          {comp %_len,2} {ifco 1_pad}
  464.          {setv ext,0%ext}
  465.  {:1_pad}{setv ext,0%ext}
  466.  {:n_pad}{exec-n ren %qwkdr\%bbsid.%qwk %bbsid.%ext}
  467.          {retu}
  468.  
  469.   *  Rename method ala ZIPNEWS
  470.   *
  471.  {:znr}  {exec-n dir %znpak\%bbsid.z* > %ramdr\temp}
  472.          {setv ext,0}
  473.          {rope %ramdr\temp,z_ren}
  474.  {:znr_l}{read line}
  475.          {subs count,11,2,%line}
  476.          {comp count,%ext}
  477.          {ifco-ge ,znr_l}
  478.          {setv ext,%count}
  479.          {goto znr_l}
  480.  {:z_ren}{incr ext}
  481.          {leng %ext}
  482.          {comp %_len,2} {ifco no_pd}
  483.          {setv ext,0%ext}
  484.  {:no_pd}{exec-n ren %znpak\%bbsid.%qwk %bbsid.z%ext}
  485.          {retu}
  486.  
  487.  ┌──────────────────────────────────────┐
  488.  │  .QWK and .REP protocol subroutines  │
  489.  └──────────────────────────────────────┘
  490.   *  This arrangement provides a method to use a variety of mail
  491.   *  transfer protocols.
  492.  
  493.  ┌──────────┐
  494.  │  Zmodem  │
  495.  └──────────┘
  496.  {:ulrep-z}
  497.  {:ulrep-}                              ;default protocol is "Z"
  498.          {look ^xB01}                   ;Zmodem .REP Upload
  499.          {exec-n %z_prog port %_por ha bo sz -m %repdr\%bbsid.%rep}
  500.          {ifer 1,,delrep}
  501.          {retu}
  502.  
  503.  {:dlqwk-z}
  504.  {:dlqwk-}                              ;default protocol is "Z"
  505.          {push}                         ;Zmodem .QWK Download
  506.          {golo g|,<G> to start}         ;for DCQwk/TAG
  507.          {look ^xB00}
  508.          {pops}
  509.          {exec-n %z_prog port %_por ha bo rz -mr %qwkdr}
  510.          {retu}
  511.  
  512.  ┌──────────┐
  513.  │  Ymodem  │
  514.  └──────────┘
  515.  {:ulrep-y}                             ;Ymodem .REP Upload
  516.          {paus 5}
  517.          {symo-k %repdr\%bbsid.%rep}
  518.          {ifer 1,,delrep}               ;Goto delete .REP if trans OK
  519.          {retu}
  520.  
  521.  {:dlqwk-y}                             ;Ymodem .QWK Download
  522.          {paus 5}
  523.          {send g}                       ;for DCQwk/TAG
  524.          {rymo-y %qwkdr}                ;overwrite exiting files
  525.          {retu}
  526.  
  527.  ┌──────────┐
  528.  │  Xmodem  │
  529.  └──────────┘
  530.  {:ulrep-x}                             ;Xmodem .REP Upload
  531.          {paus 5}
  532.          {sxmo-k %repdr\%bbsid.%rep}
  533.          {ifer 1,,delrep}               ;Goto delete .REP if trans OK
  534.          {retu}
  535.  
  536.  {:dlqwk-x}                             ;Xmodem .QWK Download
  537.          {paus 5}
  538.          {send g}
  539.          {rxmo-y %qwkdr\%bbsid.%qwk}
  540.          {retu}
  541.  
  542.  ┌────────────────────┐
  543.  │  .REP File Delete  │
  544.  └────────────────────┘
  545.  {:delrep}
  546.          {exec-n del %repdr\%bbsid.%rep}
  547.          {retu}
  548.  
  549.  ┌────────────────────────────────────────┐
  550.  │  Functions called from %flag variable  │
  551.  └────────────────────────────────────────┘
  552.  
  553.  {:newfiles}
  554.          {setv strip,n}
  555.          {call stripflag}
  556.          {clea}
  557.          {send n s u|}
  558.          {capt y,%savedir\newfiles.%abbr}
  559.          {push}
  560.          {golo |,more?}
  561.          {look %bbs_pmt}
  562.          {pops}
  563.          {clea}
  564.          {capt n}
  565.          {send ~~|}
  566.          {retu}
  567.  
  568.  ┌──────────────────────────────────────────┐
  569.  │  Strip the acted-on function from %flag  │
  570.  └──────────────────────────────────────────┘
  571.   *  This subroutine strips the variable %flag of one character
  572.   *  so that each %flag function is run only once.
  573.  
  574.  {:stripflag}
  575.          {inst %flag,%strip}
  576.          {comp _pos,1}  {ifco fl2}
  577.          {setv pos,%_pos}               {decr pos}
  578.          {subs flag1,1,%pos,%flag}
  579.   {:fl2} {setv pos,%_pos}               {incr pos}
  580.          {subs flag2,%pos,36,%flag}
  581.          {setv flag,%flag1%%flag2}
  582.          {setv pos}
  583.          {setv strip}
  584.          {setv flag1}
  585.          {setv flag2}
  586.          {retu}
  587.  
  588.